package huy.mmt.gamelathinh.config;

import android.app.Activity;

public class Config {
	/**
	 * Chiá»�u cao vÃ  rá»™ng mÃ n hinh
	 */
	public static int SCREENWIDTH = 480, SCREENHIEGHT = 800;

	/**
	 * Chá»�n tá»‰ lá»‡ mÃ m hÃ¬nh chá»�n vá»›i Ä‘iá»‡n thoáº¡i tháº­t lÃ  1 : 1
	 * 
	 */
	public static float RACE_HEIGHT = 1f;
	public static float RACE_WIDTH = 1f;

	/**
	 * Chiá»�u rá»™ng vÃ  cao cá»§a cÃ¡c item (px)
	 */
	public static int ITEM_WIDTH = 40;
	public static int ITEM_HEIGHT = 40;

	/**
	 * Chá»§ Ä‘á»� máº·c Ä‘á»‹nh trong game lÃ  Ä‘áº§u tiÃªn : Hoa quáº£
	 */
	public static int THEMES = 1;
	/**
	 * Cháº¿ Ä‘á»™ máº·c Ä‘á»‹nh ban Ä‘áº§u khi vÃ o game lÃ  dá»…
	 **/
	public static int Do_kho = 1;

	// Ban dau level = 1

	/**
	 * CÄƒn chá»‰nh chuyá»ƒn Ä‘á»•i tá»· lá»‡ mÃ n hÃ¬nh vá»›i layout game
	 * 
	 * @param mActivity
	 */

	public static void getDisplayScreen(Activity mActivity) {
		SCREENWIDTH = mActivity.getWindowManager().getDefaultDisplay()
				.getWidth();
		SCREENHIEGHT = mActivity.getWindowManager().getDefaultDisplay()
				.getHeight();

		RACE_WIDTH = (float) SCREENWIDTH / (float) 800;
		RACE_HEIGHT = (float) SCREENHIEGHT / (float) 480;

		if (SCREENHIEGHT >= 320 && SCREENHIEGHT < 480) {
			ITEM_WIDTH = 40;
			ITEM_HEIGHT = 40;
		}
		if (SCREENHIEGHT < 320) {
			ITEM_WIDTH = 29;
			ITEM_HEIGHT = 32;
		}
		if (SCREENHIEGHT >= 800 && SCREENWIDTH >= 1200) {
			ITEM_WIDTH = 90;
			ITEM_HEIGHT = 90;
		}

	}

	// ---------------------------------------------------------------
	/**
	 * Ä�Æ°a ra tá»‰ lá»‡ chiá»�u rá»™ng vÃ  chiá»�u cao
	 * 
	 * @return
	 */
	public static float getRaceWidth() {
		return RACE_WIDTH;
	}

	public static float getRaceHeight() {
		return RACE_HEIGHT;
	}

	/**
	 * Láº¥y tiÃªu Ä‘iá»ƒm giá»¯a mÃ n hÃ¬nh
	 * 
	 * @return
	 */
	public static int getCenterX() {
		return SCREENWIDTH / 2;
	}

	public static int getCenterY() {
		return SCREENHIEGHT / 2;
	}

	public String getNameTheme(int int_theme) {
		String name_theme = null;
		int_theme = Config.THEMES;
		if (int_theme == 1) {
			name_theme = "Fruit";
		}
		if (int_theme == 2) {
			name_theme = "Transport";
		}
		if (int_theme == 3) {
			name_theme = "Animals";
		}
		if (int_theme == 4) {
			name_theme = "Maths";
		}
		return name_theme;
	}

	public String getNameDif(int int_dif) {
		String name_dif = null;
		int_dif = Config.THEMES;
		if (int_dif == 1) {
			name_dif = "Easy";
		}
		if (int_dif == 2) {
			name_dif = "Medium";
		}
		if (int_dif == 3) {
			name_dif = "Hard";
		}
		return name_dif;
	}
}
